import { makeAutoObservable } from 'mobx';

export default class GlobalStore {
  constructor() {
    makeAutoObservable(this);
    const them = localStorage.getItem('them') || 'light';
    this.setThem(them);
  }

  them = 'light';

  nasConfig = {};

  showLoginModal = false;

  setThem(them) {
    this.them = them;
    localStorage.setItem('them', them);
    const html = document.querySelector('html');
    if (html) {
      html.className = them;
      html.setAttribute('data-theme', them);
    }
  }
}
